package com.yjs.tigao.controller;

import com.yjs.tigao.pojo.Brand;
import com.yjs.tigao.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 品牌
 * 控制器
 */
@Controller
@RequestMapping("/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;
    @GetMapping(value= "/list")
    public String list(Model model){
        List<Brand> brands=brandService.findAll();
        model.addAttribute("brandssss",brands);
        return "index";

    }
}
